home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
Notification.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
5KB
|
167 lines
{
File: Notification.p
Contains: Notification Manager interfaces
Version: Technology: System 7.5
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT Notification;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __NOTIFICATION__}
{$SETC __NOTIFICATION__ := 1}
{$I+}
{$SETC NotificationIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __TYPES__}
{$I Types.p}
{$ENDC}
{$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
{$IFC UNDEFINED __OSUTILS__}
{$I OSUtils.p}
{$ENDC}
{$ENDC}
{$IFC UNDEFINED __COLLECTIONS__}
{$I Collections.p}
{$ENDC}
{$IFC UNDEFINED __KERNEL__}
{$I Kernel.p}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
{ ------------------ }
{$IFC FOR_SYSTEM8_PREEMPTIVE }
TYPE
NotificationRef = ^LONGINT;
{ notification status flags }
CONST
kInvalidNotification = 1; { notification ref invalid }
kUnSentNotification = 2; { notification not yet sent }
kPostedNotification = 3; { notification has been posted }
TYPE
NotificationStatus = UInt32;
{ notification tags }
CONST
kNotificationTypeTag = 'type'; { type of notification (multiple types allowed) }
kNotificationRefTag = 'nref'; { notification ref (usually retrieved at completion) }
kTextNotificationTag = 'text'; { ASCII text }
kTextObjectNotificationTag = 'tobj'; { text object model format text }
kSoundNotificationTag = 'snd '; { sound data in format of 'snd ' resource }
kSmall8BitIconTag = 'ics8'; { 8-bit icon }
kSmall4BitIconTag = 'ics4'; { 4-bit icon }
kSmall1BitMaskIconTag = 'ics#'; { 1-bit icon w/mask }
kProcessSerialNumberTag = 'psn '; { psn we wish to mark }
{ notification module identifiers }
kAlertNotifier = 'alrt'; { display a modal alert with OK button }
kSoundNotifier = 'snd '; { play a sound }
kProcessMenuNotifier = 'pmnu'; { flash icon in title of process menu }
kAppleMenuNotifier = 'amnu'; { flash icon in title of apple menu }
kMenuMarkNotifier = 'mmrk'; { put a mark in the process menu }
TYPE
NotifierType = OSType;
{ notification posting options }
CONST
kAutoDisposeOnCompletionMask = $00000001; { dispose the notification request on completion }
TYPE
NotificationOptions = OptionBits;
{ ------------------ }
FUNCTION NewNotificationRef(VAR notification: NotificationRef): OSStatus;
FUNCTION AddNotificationCollectionItem(notification: NotificationRef; tag: CollectionTag; id: UInt32; itemData: UNIV Ptr; itemSize: ByteCount): OSStatus;
FUNCTION GetNotificationCollectionItem(notification: NotificationRef; tag: CollectionTag; id: UInt32; VAR dataPtr: UNIV Ptr; VAR itemSize: ByteCount): OSStatus;
FUNCTION PostNotification(notification: NotificationRef; {CONST}VAR completion: KernelNotification; timeOut: Duration; postingOptions: NotificationOptions): OSStatus;
FUNCTION GetNotificationStatus(notification: NotificationRef): NotificationStatus;
FUNCTION DisposeNotificationRef(notification: NotificationRef): OSStatus;
FUNCTION NewNotificationRefFromMemory(messageBuffer: UNIV Ptr; size: ByteCount; VAR notification: NotificationRef): OSStatus;
FUNCTION GetFlattenedNotificationSize(notification: NotificationRef): ByteCount;
FUNCTION FlattenNotification(notification: NotificationRef; buffer: UNIV Ptr): OSStatus;
{$ENDC}
{ ------------------ }
{ ------------------ }
{$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
TYPE
NMRecPtr = ^NMRec;
NMProcPtr = ProcPtr; { PROCEDURE NM(nmReqPtr: NMRecPtr); }
NMUPP = UniversalProcPtr;
NMRec = RECORD
qLink: QElemPtr; { next queue entry }
qType: INTEGER; { queue type -- ORD(nmType) = 8 }
nmFlags: INTEGER; { reserved }
nmPrivate: LONGINT; { reserved }
nmReserved: INTEGER; { reserved }
nmMark: INTEGER; { item to mark in Apple menu }
nmIcon: Handle; { handle to small icon }
nmSound: Handle; { handle to sound record }
nmStr: StringPtr; { string to appear in alert }
nmResp: NMUPP; { pointer to response routine }
nmRefCon: LONGINT; { for application use }
END;
CONST
uppNMProcInfo = $000000C0;
PROCEDURE CallNMProc(nmReqPtr: NMRecPtr; userRoutine: NMUPP);
{$IFC NOT GENERATINGCFM}
INLINE $205F, $4E90;
{$ENDC}
FUNCTION NewNMProc(userRoutine: NMProcPtr): NMUPP;
{$IFC NOT GENERATINGCFM }
INLINE $2E9F;
{$ENDC}
{ ------------------ }
FUNCTION NMInstall(nmReqPtr: NMRecPtr): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $205F, $A05E, $3E80;
{$ENDC}
FUNCTION NMRemove(nmReqPtr: NMRecPtr): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $205F, $A05F, $3E80;
{$ENDC}
{$ENDC}
{ ------------------ }
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := NotificationIncludes}
{$ENDC} {__NOTIFICATION__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}